PP=g++ -g --std=c++20
SRC_PATH=src
BIN_PATH=build

saddle: $(BIN_PATH)/pathinfo $(SRC_PATH)/main.cpp $(BIN_PATH)/integer_table.o $(BIN_PATH)/coordinate_2d.o
	$(PP) -o $(BIN_PATH)/saddle $(BIN_PATH)/coordinate_2d.o $(BIN_PATH)/integer_table.o $(SRC_PATH)/main.cpp

$(BIN_PATH)/coordinate_2d.o: $(SRC_PATH)/coordinate_2d.h $(SRC_PATH)/coordinate_2d.cpp
	$(PP) -c -o $(BIN_PATH)/coordinate_2d.o $(SRC_PATH)/coordinate_2d.cpp

$(BIN_PATH)/integer_table.o: $(SRC_PATH)/integer_table.cpp $(SRC_PATH)/table.hpp
	$(PP) -c -o $(BIN_PATH)/integer_table.o $(SRC_PATH)/integer_table.cpp

$(BIN_PATH)/pathinfo:
	mkdir -p $(BIN_PATH)
	touch $(BIN_PATH)/pathinfo

clean:
	rm -rf $(BIN_PATH)